<?php
session_start();
//Konfigurasi
include('../conf/setup.php');

//Library
include('../class.mamatblog/mysql.php');

//Database Object
define(IMPORT,'../class.mamatblog/',true);
require_once(IMPORT.'mysql.php');
require_once(IMPORT.'link.php');
require_once(IMPORT.'page.php');
require_once(IMPORT.'track.php');
require_once(IMPORT.'comment.php');

//comment
$comm = new Comment();
	
//Page
$page = new Page();
$pageDetail = $page->getMainPage();

//Sample Artikel
$strSampleArtikel = "";
for($i=0;$i < count($pageDetail);$i++) {
	$cont = $page->parseStr(nl2br(str_replace('[/code]','</pre></div>',(str_replace('[code]','<div style="background-color:#ACB5F2;color:#000000;"><pre>',$pageDetail[$i][3])))),50);
	
	$strSampleArtikel .="<h3><a href=\"pagedetail.php?pid=".$pageDetail[$i][0]."\">".$pageDetail[$i][2]."</a></h3>
	<small><i>Posted on ".$pageDetail[$i][1]." by ".$page->getPageAuthor($pageDetail[$i][5]).", ".$comm->getCommentRows($pageDetail[$i][0])." Comments</i></small>
<p>$cont<a href=\"pagedetail.php?pid=".$pageDetail[$i][0]."\">...more</a></p>
";
	
}
$smarty->assign('content',$strSampleArtikel);

include('menukiri.php');
//View
$smarty->display('index.tpl');
include('track.php');
?>